from django.shortcuts import render,redirect
from django.contrib import auth
from django.contrib.auth.models import User
from django.http import HttpResponse

def funcpage(request):
    res = {}
    status = request.session.get('user_id')
    res['res'] = "你成功登陆了"
    if status:
        return render(request, 'funcpage.html',res)
    else:
        return  redirect('http://localhost:8000/login')

def logout(request):
    request.session.flush()
    return redirect('http://localhost:8000/login')
    
